<template>
	<view>
		<view class="header status_bar" :class="scrrol == true ? 'scrrolHeader' : ''">
			<view class="back iconfont icon-xiangzuo1" @tap="backPage"></view>
			<view class="text" :class="scrrol == true ? 'scrrolHeader' : ''">{{Lang.lang('消息')}}</view>
			<view class="back"></view>
			<!-- <view class="rule">规则</view> -->
		</view>
		<view class="clear_box"></view>

		<view class="page_content">
			<block v-for="(item, index) in log_list" :key="'info' + index">
				<view class="tidings_box">
					<view class="time">{{item.create_time}}</view>
					<view class="content">
						<view class="title_box">
							<view class="round" v-if="item.is_read == 0"></view>
							<view class="title">{{Lang.lang('消息通知')}}</view>
						</view>
						<view class="text">{{item.content}}</view>
					</view>
				</view>
			</block>
		</view>



	</view>
</template>

<script>
	export default {
		data() {
			return {
				lang: 'en',
				link: '',
				pupu: false,
				scrrol: false,
				info: '',
				page: 0,
				log_list: [],
			}
		},
		onLoad() {

		},
		onShow() {
			let that = this;
			that.loadData();
		},
		methods: {
			loadData() {
				let that = this;
				that.page = 0;
				that.log_list = [];
				that.loadPageData();
			},
			loadPageData() {
				let that = this;
				that.page++;
				that.Net._post('api/index/userMessageIndex', {
					page: that.page
				}, res => {
					if (res.code == 200) {
						that.log_list = that.log_list.concat(res.data.log_list); //将数据拼接在一起
					}
				});
			},
			backPage() {
				uni.navigateBack({});
			},
			gotopage(e) {
				let url = e.currentTarget.dataset.url;
				uni.navigateTo({
					url: url
				});
			},
		},
		onPageScroll: function(Object) {
			//console.log(Object.scrollTop); //实时获取到滚动的值
			if (Object.scrollTop > 28) {
				this.scrrol = true;
				/* #ifdef APP-PLUS */
				/* #endif */
			} else if (Object.scrollTop < 28) {
				this.scrrol = false;
				/* #ifdef APP-PLUS */
				/* #endif */
			}
		},
		onReachBottom() {
			let that = this;
			that.loadPageData()
		},
	}
</script>

<style>
	.header {
		background-color: transparent !important;
	}

	.header .text {
		text-align: center;
	}

	.page_content {
		width: 92%;
		margin: 0 auto;
	}

	.scrrolHeader {
		width: 100%;
		background-color: #1A1A1A !important;

	}

	.tidings_box {
		width: 92%;
		margin: 0 auto;
		margin-bottom: 5vw;
	}

	.tidings_box .time {
		font-size: 3vw;
		color: #fff;
		text-align: center;
		height: 10.5vw;
		line-height: 10.5vw;
	}

	.tidings_box .content {
		background-color: #1A1A1A;
		border-radius: 4vw;
		padding: 1.5vw 3vw 3vw 3vw;
		box-shadow: 0px 1px 4.65px 0.35px rgba(51, 51, 51, 0.09);
	}

	.tidings_box .content .title_box {
		display: flex;
	}

	.tidings_box .content .title_box .round {
		width: 2vw;
		height: 2vw;
		border-radius: 50%;
		background-color: #0155FF;
		margin-top: 4.25vw;
	}

	.tidings_box .content .title_box .title {
		line-height: 10.5vw;
		font-size: 4vw;
		color: #fff;
		margin-left: 1.5vw;
		font-weight: bold;
	}

	.tidings_box .content .text {
		font-size: 3vw;
		color: #fff;
		line-height: 5vw;
	}

	.tidings_box .content .goods {
		width: 100%;
		display: flex;
	}

	.tidings_box .content .goods .goods_img {
		width: 24vw;
		height: 24vw;
		border-radius: 2vw;
		margin-right: 3vw;
	}

	.tidings_box .content .goods .goods_img image {
		width: 100%;
		height: 100%;
		border-radius: 2vw;
	}

	.tidings_box .content .goods .title {
		flex: 1;
		margin-right: 3vw;
		font-size: 3.5vw;
		color: #333;
		line-height: 5vw;
		display: flex;
		align-items: center;
	}
</style>